import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class 数字诗意 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        List<Integer> nums = new ArrayList<>();
        List<Integer> isNums = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            int an = scanner.nextInt();
            nums.add(an);
            int sum = 0;
            for (int j = 1; j <= an; j++){
                sum += j;
                if (sum == an){
                    isNums.add(an);
                }
            }
        }
        List<Integer> isNotNums = new ArrayList<>(nums);
        for (Integer isNum : isNums) {
            if (nums.contains(isNum)){
                isNotNums.remove(isNum);
            }
        }
        System.out.println(isNotNums.size());

    }
}
